package com.nattakute.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nattakute.dao.ResourceDAO;
import com.nattakute.model.Resource;
import com.nattakute.service.ResourceService;

@Service("resourceService")
@Transactional
public class ResourceServicesImpl implements ResourceService{

	@Autowired
	private ResourceDAO resourceDAO;
	
	
	@Transactional
	public List<Resource> getResource() {
		// TODO Auto-generated method stub
		return resourceDAO.getResource();
	}

	
	@Transactional
	public Resource getResourceById(Integer id) {
		// TODO Auto-generated method stub
		return resourceDAO.getResourceById(id);
	}

	
	@Transactional
	public Boolean addResource(Resource resource) {
		// TODO Auto-generated method stub
		return resourceDAO.addResource(resource);
	}

	
	@Transactional
	public Boolean deleteResource(Resource resource) {
		// TODO Auto-generated method stub
		return resourceDAO.deleteResource(resource);
	}

	
	@Transactional
	public Boolean updateResource(Resource resource) {
		// TODO Auto-generated method stub
		return resourceDAO.updateResource(resource);
	}

	
	@Transactional
	public List<Resource> getResourceInLab(String labId) {
		// TODO Auto-generated method stub
		return resourceDAO.getResourceInLab(labId);
	}


	public void setResourceDAO(ResourceDAO resourceDAO) {
		this.resourceDAO = resourceDAO;
	}
	
	

}
